<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1999-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ISO_C_BINDING (The GNU Fortran Compiler)</title>

<meta name="description" content="ISO_C_BINDING (The GNU Fortran Compiler)">
<meta name="keywords" content="ISO_C_BINDING (The GNU Fortran Compiler)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Intrinsic-Modules.html#Intrinsic-Modules" rel="up" title="Intrinsic Modules">
<link href="IEEE-modules.html#IEEE-modules" rel="next" title="IEEE modules">
<link href="ISO_005fFORTRAN_005fENV.html#ISO_005fFORTRAN_005fENV" rel="prev" title="ISO_FORTRAN_ENV">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<a name="ISO_005fC_005fBINDING"></a>
<div class="header">
<p>
Next: <a href="IEEE-modules.html#IEEE-modules" accesskey="n" rel="next">IEEE modules</a>, Previous: <a href="ISO_005fFORTRAN_005fENV.html#ISO_005fFORTRAN_005fENV" accesskey="p" rel="prev">ISO_FORTRAN_ENV</a>, Up: <a href="Intrinsic-Modules.html#Intrinsic-Modules" accesskey="u" rel="up">Intrinsic Modules</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="ISO_005fC_005fBINDING-1"></a>
<h3 class="section">9.2 <code>ISO_C_BINDING</code></h3>
<dl compact="compact">
<dt><em>Standard</em>:</dt>
<dd><p>Fortran 2003 and later, GNU extensions
</p></dd>
</dl>

<p>The following intrinsic procedures are provided by the module; their
definition can be found in the section Intrinsic Procedures of this
manual.
</p>
<dl compact="compact">
<dt><code>C_ASSOCIATED</code></dt>
<dt><code>C_F_POINTER</code></dt>
<dt><code>C_F_PROCPOINTER</code></dt>
<dt><code>C_FUNLOC</code></dt>
<dt><code>C_LOC</code></dt>
<dt><code>C_SIZEOF</code></dt>
</dl>

<p>The <code>ISO_C_BINDING</code> module provides the following named constants of
type default integer, which can be used as KIND type parameters.
</p>
<p>In addition to the integer named constants required by the Fortran 2003 
standard and <code>C_PTRDIFF_T</code> of TS 29113, GNU Fortran provides as an
extension named constants for the 128-bit integer types supported by the
C compiler: <code>C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T</code>.
Furthermore, if <code>_Float128</code> is supported in C, the named constants
<code>C_FLOAT128</code> and <code>C_FLOAT128_COMPLEX</code> are defined.
</p>
<table>
<thead><tr><th width="19%">Fortran Type</th><th width="32%">Named constant</th><th width="34%">C type</th><th width="15%">Extension</th></tr></thead>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT</code></td><td width="34%"><code>int</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_SHORT</code></td><td width="34%"><code>short int</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_LONG</code></td><td width="34%"><code>long int</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_LONG_LONG</code></td><td width="34%"><code>long long int</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_SIGNED_CHAR</code></td><td width="34%"><code>signed char</code>/<code>unsigned char</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_SIZE_T</code></td><td width="34%"><code>size_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT8_T</code></td><td width="34%"><code>int8_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT16_T</code></td><td width="34%"><code>int16_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT32_T</code></td><td width="34%"><code>int32_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT64_T</code></td><td width="34%"><code>int64_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT128_T</code></td><td width="34%"><code>int128_t</code></td><td width="15%">Ext.</td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_LEAST8_T</code></td><td width="34%"><code>int_least8_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_LEAST16_T</code></td><td width="34%"><code>int_least16_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_LEAST32_T</code></td><td width="34%"><code>int_least32_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_LEAST64_T</code></td><td width="34%"><code>int_least64_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_LEAST128_T</code></td><td width="34%"><code>int_least128_t</code></td><td width="15%">Ext.</td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_FAST8_T</code></td><td width="34%"><code>int_fast8_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_FAST16_T</code></td><td width="34%"><code>int_fast16_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_FAST32_T</code></td><td width="34%"><code>int_fast32_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_FAST64_T</code></td><td width="34%"><code>int_fast64_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INT_FAST128_T</code></td><td width="34%"><code>int_fast128_t</code></td><td width="15%">Ext.</td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INTMAX_T</code></td><td width="34%"><code>intmax_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_INTPTR_T</code></td><td width="34%"><code>intptr_t</code></td></tr>
<tr><td width="19%"><code>INTEGER</code></td><td width="32%"><code>C_PTRDIFF_T</code></td><td width="34%"><code>ptrdiff_t</code></td><td width="15%">TS 29113</td></tr>
<tr><td width="19%"><code>REAL</code></td><td width="32%"><code>C_FLOAT</code></td><td width="34%"><code>float</code></td></tr>
<tr><td width="19%"><code>REAL</code></td><td width="32%"><code>C_DOUBLE</code></td><td width="34%"><code>double</code></td></tr>
<tr><td width="19%"><code>REAL</code></td><td width="32%"><code>C_LONG_DOUBLE</code></td><td width="34%"><code>long double</code></td></tr>
<tr><td width="19%"><code>REAL</code></td><td width="32%"><code>C_FLOAT128</code></td><td width="34%"><code>_Float128</code></td><td width="15%">Ext.</td></tr>
<tr><td width="19%"><code>COMPLEX</code></td><td width="32%"><code>C_FLOAT_COMPLEX</code></td><td width="34%"><code>float _Complex</code></td></tr>
<tr><td width="19%"><code>COMPLEX</code></td><td width="32%"><code>C_DOUBLE_COMPLEX</code></td><td width="34%"><code>double _Complex</code></td></tr>
<tr><td width="19%"><code>COMPLEX</code></td><td width="32%"><code>C_LONG_DOUBLE_COMPLEX</code></td><td width="34%"><code>long double _Complex</code></td></tr>
<tr><td width="19%"><code>COMPLEX</code></td><td width="32%"><code>C_FLOAT128_COMPLEX</code></td><td width="34%"><code>_Float128 _Complex</code></td><td width="15%">Ext.</td></tr>
<tr><td width="19%"><code>LOGICAL</code></td><td width="32%"><code>C_BOOL</code></td><td width="34%"><code>_Bool</code></td></tr>
<tr><td width="19%"><code>CHARACTER</code></td><td width="32%"><code>C_CHAR</code></td><td width="34%"><code>char</code></td></tr>
</table>

<p>Additionally, the following parameters of type <code>CHARACTER(KIND=C_CHAR)</code>
are defined.
</p>
<table>
<thead><tr><th width="20%">Name</th><th width="45%">C definition</th><th width="15%">Value</th></tr></thead>
<tr><td width="20%"><code>C_NULL_CHAR</code></td><td width="45%">null character</td><td width="15%"><code>'\0'</code></td></tr>
<tr><td width="20%"><code>C_ALERT</code></td><td width="45%">alert</td><td width="15%"><code>'\a'</code></td></tr>
<tr><td width="20%"><code>C_BACKSPACE</code></td><td width="45%">backspace</td><td width="15%"><code>'\b'</code></td></tr>
<tr><td width="20%"><code>C_FORM_FEED</code></td><td width="45%">form feed</td><td width="15%"><code>'\f'</code></td></tr>
<tr><td width="20%"><code>C_NEW_LINE</code></td><td width="45%">new line</td><td width="15%"><code>'\n'</code></td></tr>
<tr><td width="20%"><code>C_CARRIAGE_RETURN</code></td><td width="45%">carriage return</td><td width="15%"><code>'\r'</code></td></tr>
<tr><td width="20%"><code>C_HORIZONTAL_TAB</code></td><td width="45%">horizontal tab</td><td width="15%"><code>'\t'</code></td></tr>
<tr><td width="20%"><code>C_VERTICAL_TAB</code></td><td width="45%">vertical tab</td><td width="15%"><code>'\v'</code></td></tr>
</table>

<p>Moreover, the following two named constants are defined:
</p>
<table>
<thead><tr><th width="20%">Name</th><th width="80%">Type</th></tr></thead>
<tr><td width="20%"><code>C_NULL_PTR</code></td><td width="80%"><code>C_PTR</code></td></tr>
<tr><td width="20%"><code>C_NULL_FUNPTR</code></td><td width="80%"><code>C_FUNPTR</code></td></tr>
</table>

<p>Both are equivalent to the value <code>NULL</code> in C.
</p>


<hr>
<div class="header">
<p>
Next: <a href="IEEE-modules.html#IEEE-modules" accesskey="n" rel="next">IEEE modules</a>, Previous: <a href="ISO_005fFORTRAN_005fENV.html#ISO_005fFORTRAN_005fENV" accesskey="p" rel="prev">ISO_FORTRAN_ENV</a>, Up: <a href="Intrinsic-Modules.html#Intrinsic-Modules" accesskey="u" rel="up">Intrinsic Modules</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
